package com.tide.crm.dao;

import java.util.List;

import com.tide.crm.model.WeChatToken;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;


@Mapper
public interface WeChatTokenDao {

	
	@Select("select * from access_token t  ")
	List<WeChatToken> getWeChatToken();

    @Delete("delete from access_token ")
    int deleteAllToken();

    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into access_token(id, create_date, modify_date, access_token, expires_in, errcode, errmsg) values(#{id}, now(), now(), #{access_token}, #{expires_in}, #{errcode}, #{errmsg})")
    int saveToken(WeChatToken weChatToken);
    
}
